\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath, hyperref}
\title{TweetTrunk Requirements}
\author{Nathaniel Blake \and Erich Harkema \and Kara King \and Adam Wechter \and Eric Weyant}
\date{December 13, 2013}
\begin{document}
\maketitle

\begin{center}
``Even perfect program verification can only establish that a program meets its specification. $\dots$ Much of the essence of building a program is in fact the debugging of the specification." \\
- Frederick P. Brooks, Jr.
\end{center}

\tableofcontents

\section{Introduction}

\subsection{Purpose of the Product}
TweetTrunk is a Twitter analytics tool that is designed to give users feedback on their tweeting habits and statistics.  The Twitter service is an ever-growing part of social media, so a tool that analyzes and gives interesting feedback on the uses of individuals’ accounts will be useful to many people.

\subsection{Scope of the Product}
TweetTrunk will provide a suite of tweet analysis tools for a single authorized Twitter user. Each tool will provide a single metric in either text or visual form, and analysis beyond this information will be left to the user (or supplemental tools).

\subsection{Acronyms, Abbreviations, and Definitions}
\begin{itemize}
\item \textit{Tweet} - a posting made on the social networking site Twitter.  Limited to 140 characters.
\item \textit{Hashtag} - a word or phrase preceded by a pound sign (\#) and used to identify messages on a specific topic.
\end{itemize}

\subsection{References}



\section{General Description of Product}

\subsection{Context of Product}
TweetTrunk will be used by Twitter users to get information about patterns in their Tweet history. This product is being developed as a final project for Computer Science 290 at Allegheny College.

\subsection{Product Functions}
\label{sec:prod-func}
\begin{itemize}
\item TweetTrunk will provide several analytics that allow users to view portions of their Tweets history and patterns therein.
In particular, Version 1.0 of TweetTrunk will offer the following analysis techniques:
\begin{itemize}
\item Search for pattern within status text
\item Fetch Tweets between date range
\item Hashtag usage cloud
\item Tweet frequency by time of day
\item Geolocation data for Tweets
\end{itemize}
\item Single-user Tweets database management, including resetting the database.
\item Command-line Java interface, described in~\nameref{sec:CLI}
\end{itemize}

\subsection{User Characteristics}
Users of TweetTrunk must have access to a Twitter account, and users should have a reasonable number of past tweets (no fewer than 50) in order to provide interesting and useful analyses.

\subsection{Constraints}
\subsubsection{Process Constraints}
There is an intermediate deadline for the project on December 4, 2013, at which point the project must be far enough progressed to demonstrate preliminary functionality to a class audience.

The final deadline for the project is December 13, 2013, at 5 p.m.

\section{Specific Requirements}
\subsection{External Interface Requirements}
\subsubsection{Command Line Interface}
\label{sec:CLI}
The TweetTrunk build system will provide a \texttt{jar} build target that enables creation of a \texttt{.jar} file. From this point, users can run TweetTrunk using the following command:

\begin{center}\texttt{\textbf{java -jar TweetTrunk.jar}}\end{center}

The command line interface will provide functionality for the following command-line arguments.
\begin{itemize}
\item \texttt{-authenticate} allows a user to authorize TweetTrunk to access his or her Twitter account.
\item \texttt{-addArchive} allows a user to import Tweets from a Twitter archive.
\item \texttt{-analysis} allows a user to run one of the analysis techniques described in~\nameref{sec:prod-func}.
\item \texttt{-startDate} allows a user to provide a start date bound for analyses, in the format \texttt{"YYYY-MM-DD HH:MM:SS"}.
\item \texttt{-endDate} allows a user to provide an end date bound for analyses, in the format \texttt{"YYYY-MM-DD HH:MM:SS"}.
\item \texttt{-pattern} allows a user to provide a pattern that will be searched for in Tweets' status text.
\item \texttt{-fetchNewTweets} allows a user to fetch recent Tweets that are not in the database from the Twitter server.
\item \texttt{-resetAccount} removes all Tweets from the database.
\item \texttt{-deleteAccount} removes all Tweets from the database and deletes stored authentication details, thus removing any usage history of the user.
\end{itemize}

\subsubsection{Software Interfaces}
Analysis methods and account management tools shall be provided at the API level from the \texttt{org.tweettrunk.core} package.

\subsection{Functional Requirements}
\subsubsection{Functionality}
The TweetTrunk system will provide the following functionality:
\begin{enumerate}
\item TweetTrunk will offer a mechanism for authenticating access to a user's Twitter account by providing a PIN.
\item TweetTrunk will import a set of past Tweets from a Twitter archive (as described at \url{https://blog.twitter.com/2012/your-twitter-archive}).
\item TweetTrunk will notify a user when new Tweets are available online that are not already in the database, and it will allow a user to fetch new Tweets.
\item TweetTrunk will provide the user with the ability to run any of the analysis techniques described in~\nameref{sec:prod-func}.
\item TweetTrunk will allow a user both to reset the active account, which removes all Tweets from the database, and to delete the active account, which deletes all stored Tweets from the database and clears saved authentication information.
\end{enumerate}
\subsubsection{Data}
TweetTrunk will manage the extraction and parsing of a Twitter archive file. All Tweets extracted from the archive, along with those fetched from the Twitter servers, will be stored in a SQLite3 database in the \texttt{.tweettrunk} directory in the user's home directory.

\subsection{Performance Requirements}
No analysis shall take more than 5 seconds for a user with up to 10,000 tweets.

\subsection{Design Constraints}
All analysis methods require that at least one Tweet has been imported into the database in order to provide a result.

\subsection{Quality Requirements}
\subsubsection{Design Quality}
\begin{itemize}
\item Methods should have a cyclomatic complexity number less than 10.
\item Methods should have a distance from the main sequence that is less than 0.4.
\item Every class and every method should have a Javadoc comment.
\item Test coverage should be at least 85\%.
\end{itemize}

\subsubsection{Usability}
Each user interface for TweetTrunk will provide usage instructions for each of its analysis methods.

Users should not be able to import a Twitter archive that does not match their authenticated Twitter account in order to prevent user confusion and inaccurate analyses.

\subsubsection{Security}
OAuth authentication will be used to ensure secure access to the user's Twitter account.

Data that persists in the system's database will not be secured; this is under the assumption that all Tweet information is already public, and thus, aside from account-level access protection, the system should not take measures to protect the tweet data itself.

\subsubsection{Maintainability}
Updates to the system will take one of two forms: $(1)$ correction of faults in the system or $(2)$ additions of analysis methods to the system.

\end{document}

